<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Captcha extends Front_Controller {
    public function __construct(){
        parent::__construct();
        $this->load->model('captcha_model');
    }
    public function index(){
       echo $this->captcha_model->make_captcha();
        exit();
    }

    public function validate(){
        if($this->session->userdata('word')=== strtolower($this->input->get_post('captcha'))){
           echo 'true';
        }else{
           echo  'false';
        }
               exit();

    }
}